<?php



namespace Home\Controller;



/**
*
*/

class FeedbackController extends HomeController

{

	/**
	 * 用户反馈
	 */

	public function add(){

		if (IS_POST) {

			if ($_POST['content'] == '') {

				$this -> ajaxReturn('请填写内容信息');

			}

			$_POST['uid'] = session('uid');

			$_POST['create_time'] = time();

			// dump($_POST);die;

			if (D('Feedback') -> addFeedback($_POST)) {

				$this -> ajaxReturn('谢谢反馈，祝您生活愉快');

			} else {

				$this -> ajaxReturn('出错了');

			}

		} else {

			$this -> display();

		}

	}

}